import "virtual:svg-icons-register";
import 'uno.css';
import "element-plus/dist/index.css";
import "@/assets/styles/index.scss";
import "@/assets/styles/element.scss";

import { createApp } from "vue";
import App from "./App.vue";
import SvgIcon from '@/components/SvgIcon/index.vue'
import router, { setupRouter } from "@/router";
import { setupStore } from "@/store";
import { setupI18n } from "@/locales/index"; // 国际化
import ElementPlus from "element-plus";
import { setupGlobDirectives } from "@/directives"; // 自定义指令


(async () => {
  // console.log(import.meta.env.MODE);
  const app = createApp(App);

  // 全局注册组件
  app.component("SvgIcon", SvgIcon);

  await setupI18n(app);

  setupStore(app);

  setupRouter(app);

  app.use(ElementPlus);
  // 自定义指令
  setupGlobDirectives(app);

  // Mount when the route is ready
  // https://next.router.vuejs.org/api/#isready
  await router.isReady();

  app.mount("#app", true);
})();
